<?php

/**
 * home actions.
 *
 * @package    TMD
 * @subpackage home
 * @author     Thaihosting
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class homeActions extends sfActions
{
	/**
	 * Executes index action
	 *
	 * @param sfRequest $request A request object
	 */
	public function executeIndex(sfWebRequest $request) {
		
		//default_lang
		//$this->getUser()->setCulture('en_US');
		
		$culture = $this->getUser()->getCulture();
		
		sfContext::getInstance()->getLogger()->alert( $culture );
		
		$this->meteorologyActivitiesNews = TMDService::findLastNews( array( "announceTypeId"=> 1, "limit"=> 3 ) );
		$this->biddingsNews = TMDService::findLastNews( array( "announceTypeId"=> 2, "limit"=> 3 ) );
		$this->recruitingNews = TMDService::findLastNews( array( "announceTypeId"=> 3, "limit"=> 3 ) );
		$this->meteorologyNews = TMDService::findLastNews( array( "announceTypeId"=> 4, "limit"=> 3 ) );
		$this->warningNews = TMDService::findLastNews( array( "announceTypeId"=> 5, "limit"=> 3 ) );
		$this->weatherAndClimateNews = TMDService::findLastNews( array( "announceTypeId"=> 6, "limit"=> 3 ) );
		$this->weatherTrackingNews = TMDService::findLastNews( array( "announceTypeId"=> 7, "limit"=> 3 ) );		
	}
}
